﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<%
    var projectBasicInfo = (ProjectBasicInfo)ViewData["ProjectBasicInfo"];
     %>

     
<% if (false)
   { %>
<script src="jquery-vsdoc.js" type="text/javascript"></script>
<script src="jquery-ui-1.8.custom.min.js" type="text/javascript"></script>
<script src="jquery.form.js" type="text/javascript"></script>
<%} %>


    <script type="text/javascript" src="<%= Url.EzDeskUrl("Project", "/Scripts/gserializer.js", null) %>"></script>
    <script type="text/javascript" src="<%= Url.EzDeskUrl("Project", "/Scripts/dhtmlxgantt.js", null) %>"></script>
    <script type="text/javascript" src="<%= Url.EzDeskUrl("Project", "/Scripts/dhtmlxgantt.ext.js", null) %>"></script>

    <link href="<%= Url.EzDeskUrl("Project", "/Content/dhtmlxgantt.css", null) %>" rel="stylesheet" type="text/css" />
    

<script type="text/javascript">

    var URL_GetGanttProjectModel = '<%= Url.EzDeskUrl("Project", "/GetProjectDetailJsonView", "ajax") %>';
    var URL_SaveGanttProjectModel = '<%= Url.EzDeskUrl("Project", "/SaveProjectDetailJsonView", "ajax") %>';
    var ganttChartControl = new GanttChart();

    function loadGanttData() {
        $('#ganttContainer').empty();
        $.ajaxBusy('begin', this, $('#ganttContainer'));
        $.getJSON(URL_GetGanttProjectModel, { projectId: '<%: projectBasicInfo.Id %>' }, function (serverData) {
            ganttChartControl.loadDataIn('ganttContainer', serverData);
            $.ajaxBusy('end');
        });
    }


    $(function () {
        $('#tabs').tabs();
        loadGanttData();

        $('#btnCancelGantt').click(function () {
            loadGanttData();
        });
    });
</script>

    <div id="tabs" style="min-height: 400px">
        <ul>
            <li><a href="#tabInfo">项目信息</a></li>
            <li><a href="#tabGantt">项目任务</a></li>
            <li><a href="#tabDocs">项目文档</a></li>
            <li><a href="#tabWorknote">工作日志</a></li>
            <li><a href="#tabHistory">项目历史</a></li>
        </ul>

        <div id="tabInfo">
            <h2><%: projectBasicInfo.ProjectName %> ( <%: projectBasicInfo.ProjectNo %> )</h2>
            <div>
                项目创建时间：<%: projectBasicInfo.CreateOn.FormattedFullDate() %>
            </div>
        </div>
        <div id="tabGantt">
            项目甘特图
            <div style="border:solid #bcbcbc; border-width: 1px 2px 2px; background-color: #fff; padding: 5px;">
                <div id="titleProjectTask">
                    <b>项目任务状况</b>
                    <div style="float: right; padding-right: 10px;">
                        <input type="button" id="btnSaveGantt" value="保存" />
                        <input type="button" id="btnCancelGantt" value="撤销更改" />
                    </div>
                    <div style="clear:both"></div>
                </div>
                <div id="funcProjectTask">
                    <a>添加阶段任务</a>
                </div>
                <div id="ganttContainer" style="position:relative; width: 800px; height: 480px;"></div>
            </div>
        </div>
        <div id="tabDocs">项目的文档浏览</div>
        <div id="tabWorknote">项目工作日志</div>
        <div id="tabHistory">项目历史和回访</div>
    </div>
        <a href="<%= Url.EzDeskReturnUrl("project", "/projectList") %>">返回</a>
</asp:Content>
